package com.cloudfast.repository.annotation;

import java.lang.annotation.Documented;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;

import org.springframework.web.bind.annotation.Mapping;


/**
 * 分表
 *
 * @author liuyw
 */
@Target({ElementType.TYPE})
@Retention(RetentionPolicy.RUNTIME)
@Documented
@Mapping
public @interface SubTable {

    /**
     * 分表的规则
     *
     * @return
     */
    String rule() default MONTH;

    /**
     * 分表依据字段
     *
     * @return
     */
    String field() default "";

    static String MONTH = "month";

    static String YEAR = "year";

    static String DAY = "day";

}
